package com.jvtd.eyl.widget.adapter;

import android.databinding.ViewDataBinding;
import android.support.v4.content.ContextCompat;
import android.widget.FrameLayout;

import com.jvtd.eyl.BR;
import com.jvtd.eyl.R;
import com.jvtd.eyl.bean.binding.BrowseBean;
import com.jvtd.utils.UiUtils;
import com.jvtd.widget.adapter.JvtdQuickAdapter;
import com.jvtd.widget.adapter.viewHolder.JvtdViewHolder;
import com.sxu.shadowdrawable.ShadowDrawable;

import java.util.ArrayList;

/**
 * 我的浏览记录条目
 * 作者:chenlei
 * 时间:2018/11/14 1:22 PM
 */
public class BrowseAdapter extends JvtdQuickAdapter<BrowseBean,JvtdViewHolder> {
    public BrowseAdapter() {
        super(R.layout.adapter_browse, new ArrayList<>());
    }

    @Override
    protected void convert(JvtdViewHolder helper, BrowseBean item) {
        ViewDataBinding binding = helper.getBinding();
        binding.setVariable(BR.itemBean, item.getDocumentperiodical());
        binding.setVariable(BR.browseBean,item);
        binding.executePendingBindings();

//        FrameLayout frameLayout = helper.getView(R.id.book_img_bg);
//        ShadowDrawable.setShadowDrawable(frameLayout,UiUtils.dp2px(mContext,5), ContextCompat.getColor(mContext,R.color.color_shadow), UiUtils.dp2px(mContext,4), 0, 0);
    }
}
